package edu.cwnu.enterprisemanagement.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4JConfig {
    @Bean
    public GroupedOpenApi api4() {
        return GroupedOpenApi.builder()
                .group("all")
                .displayName("所有接口")
                .packagesToScan("edu.cwnu.enterprisemanagement.controller") //  扫描的包
                .build();
    }

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("小型企业管理API文档")
                        .description("小型企业管理API文档")
                        .version("1.0")
                        .contact(new Contact()
                                .name("YangCanyyyyyy")
                                .email("2975274582@qq.com"))
                        .license(new License()
                                .name("Apache 2.0")));
    }
}
